package drds.global_transaction.api.global_transaction_id_context;

import java.util.HashMap;
import java.util.Map;

public class ThreadLocalGlobalTransactionIdContext implements GlobalTransactionIdContext
{

	private ThreadLocal<Map<String, String>> threadLocal = new ThreadLocal<Map<String, String>>()
	{
		@Override
		protected Map<String, String> initialValue()
		{
			return new HashMap<String, String>();
		}

	};

	@Override
	public String get(String key)
	{
		return threadLocal.get().get(key);
	}

	@Override
	public String put(String key, String value)
	{
		return threadLocal.get().put(key, value);
	}

	@Override
	public String remove(String key)
	{
		return threadLocal.get().remove(key);
	}
}
